#include <iostream>

// 循环将50和100的整数相加
int main()
{
    int sum = 0;
    int val = 50;
    while(val <= 100)
    {
        sum += val;
        ++val;
    }
    std::cout << "The sum of 50 to 100 is " << sum << std::endl;
    // 使用 for循环改写
    sum = 0;
    for(int i = 50; i <= 100; ++i)
    {
        sum += i;
    }

    return 0;
}